//获取url上的请求参数
function getParams() {
    //获取问号及问号后面的内容
    var url = window.location.search; //?id=18&title=dxx
    var params = {};
    if (url.indexOf("?") != -1) {
        //截取问号后面的内容,再使用&分割多个属性  id=18&title=dxx
        var arr = url.substr(1).split("&");
        for (var i = 0; i < arr.length; i++) {
            //使用=分割为keyvalue
            var keyValue = arr[i].split("=");
            params[keyValue[0]] = keyValue[1];
        }
    }
    return params;
}

$.ajaxSettings.traditional = true;//提交ajax请求,数组不需要加[]

$.ajaxSetup({
    crossDomain: true,//允许跨域
    xhrFields: {withCredentials: true} //允许发跨域请求时也带cookie
});

var baseUrl = "http://localhost:8888";//接口端
//var baseUrl = "http://huihui.mynatapp.cc";


var getHref = function(item, value) {
    var url = $(item).data('url');
    $(item).attr("href",url+value);
}